﻿<%@ Page Title="" Language="C#" MasterPageFile="~/DCTEDU_/CanBoMaster.master" AutoEventWireup="true"
    CodeBehind="DanhSachPhanMem.aspx.cs" Inherits="QuanLyThietBi.DCTEDU_.BaoCao.DanhSachPhanMem" %>

<%@ Register Assembly="PagerControl" Namespace="CutePager" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Danh sách Phần mềm phòng học</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel runat="server" ID="upPanel1">
        <ContentTemplate>
    
            <div class="row">
                <div class="col-lg-12">
                    <section class="panel">  
            <header class="panel-heading">
                    Danh sách phần mềm hoạt động <asp:Literal runat="server" ID="litPhong"></asp:Literal> 
                    <span class="tools pull-right"> 
                    
                     <asp:LinkButton ID="cmdTaoPhanMem" runat="server" 
                 Style="float: left; position: relative; bottom: 5px;margin-right: 5px; color:white; font-weight: bold;"
                Text="Thêm phần mềm vào phòng máy" OnClick="cmdTaoPhanMem_OnClick" CausesValidation="False" CssClass="btn btn-danger btn-image-create" />  
                    <asp:DropDownList runat="server" ID="cboPhongHoc" AutoPostBack="True" OnSelectedIndexChanged="cboPhongHoc_OnSelectedIndexChanged" CssClass="form-group"/>
                    </span>
                    </header>
            <div class="panel-body">
                <div class="alert alert-danger clearfix">
                <span class="alert-icon"><i class="fa fa-envelope-o"></i></span>
                <div class="notification-info">
                    <ul class="clearfix notification-meta">
  
                    </ul>
                    <p>
                        
                        1. Chọn phòng máy muốn xem danh sách phần mềm;<br/>
                        2. Sau khi chọn phòng máy thành công, hệ thống tự động load ra danh sách phần mềm có trong hệ thống.</p>
                </div>
            </div>    
                    <asp:HiddenField ID="H_CatalogId" Value="0" runat="server" />
            <asp:Panel CssClass="row" runat="server" ID="pnPhanMem" Visible="False">   
             <asp:HiddenField runat="server" ID="H_PhongHocId" Value="0" />
    <div class="row">  
    <div class="col-lg-4">
            <div class="border-head">
                <h3>
                    Danh sách phòng máy tính<font color="red"><b><asp:Literal runat="server" ID="Literal1"></asp:Literal></b></font></h3>
            </div>
            <section class="panel">  

            <div class="panel-body">
                 
                 <table class="table table-striped">
                                <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Tên phòng</th>
                                    <th>Cán bộ quản lý</th>
                                </tr>
                                </thead>
                                <tbody>
                                <asp:Repeater runat="server" ID="rpPhongHoc" OnItemCommand="rpPhongHoc_ItemCommand"><ItemTemplate>  
                                
                                <tr>
                                    <td><%# Container.ItemIndex + 1%></td>
                                    <td><asp:LinkButton runat="server" ID="cmdSelect" CommandName="Select" CommandArgument='<%# Eval("MaPhong") %>' ><%# Eval("TenPhong") %></asp:LinkButton></td>
                                    <td><%# getTenCanBo(Eval("MaCanBo")) %></td>
                                </tr>      
                                
                                </ItemTemplate></asp:Repeater> 
                                </tbody>
                            </table>    
                            <asp:Panel runat="server" ID="pnThemPhanMem" Visible="False">
                <div class="row">
                    <div class="col-md-12">
                        <section class="panel">
            <header class="panel-heading">
                Danh mục Phần mềm
            </header>
           
            <div class="panel-body">
                <div class="row"> 
                    
                   <div class="row">
                        <label class="col-sm-3 control-label">Tên phần mềm<span style="color: Red">(*)</span></label>
                        <div class="col-sm-9">
                        <asp:TextBox ID="txtTen" ValidationGroup="dsphanmem" runat="server" CssClass="form-control canh-float-left error" MaxLength="100"  ></asp:TextBox>
                         <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ValidationGroup="dsphanmem" SetFocusOnError="true"
                                    runat="server" ErrorMessage="*" ControlToValidate="txtTen">
                                                <label class="control-label" for="inputError"><i class="fa fa-times-circle-o"></i> Chưa nhập</label>
                                            </asp:RequiredFieldValidator>
                        </div>
            
                          </div>
                   <div class="row">
                        <label class="col-sm-3 control-label">Dung lượng</label>
                        <div class="col-sm-9">
                      <asp:TextBox ID="txtDungLuong" CssClass="form-control canh-float-left" MaxLength="100"
                                    runat="server"></asp:TextBox>   
                        </div>
              
                    </div>   
  
                  <div class="row">
                        <label class="col-sm-3 control-label">Đường dẫn</label>
                        <div class="col-sm-9">
                      <asp:TextBox ID="txtDuongDan" CssClass="form-control canh-float-left" MaxLength="100"
                                    runat="server"></asp:TextBox>
                        </div>
                     </div>
                   <div class="row">
                        <label class="col-sm-3 control-label">GhiChu</label>
                        <div class="col-sm-9">
                      <asp:TextBox ID="txtGhiChu" CssClass="form-control canh-float-left" TextMode="MultiLine" Rows="3" MaxLength="200"
                                    runat="server"></asp:TextBox>
                        </div>
                
                      </div>
                   <div class="row">
                    <div class="col-lg-12">
                    <asp:Button ID="cmdSave" runat="server" ValidationGroup="dsphanmem" Text="Lưu" OnClick="cmdSave_Click" CssClass="btn btn-primary" />
                     </div>
                       </div>
               
    </div> 
             
                    </div>
                </div>
      
                </asp:Panel>
            </div> 
            </section>
        </div>
        <div class="col-lg-8">
            <section class="panel">
                        <header class="panel-heading">
                            Chọn phần mềm tương ứng
                             <span class="tools pull-right">
                                <a class="fa fa-chevron-down" href="javascript:;"></a>
                            </span>
                        </header>
                        <div class="panel-body"> 
                          <asp:LinkButton ID="cmdThemPhanMem" runat="server" 
                 Style="position: fixed; bottom: 5px;right: 105px; margin-right: 5px; color:white; font-weight: bold;"
                Text="Thêm phần mềm" OnClick="cmdThemPhanMem_OnClick" CausesValidation="False" CssClass="btn btn-default btn-image-save" />        
                        <asp:Button ID="cmdLuu" runat="server" 
                 Style="position: fixed; bottom: 5px;right: 5px; z-index: 999;"
                 Text="Cập nhật" OnClick="cmdLuu_OnClick" CausesValidation="False" CssClass="btn btn-primary btn-image-save" />  
                        <table class="table table-striped">
                                <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Tên phần mềm</th>
                                    <th>Dung lượng</th>
                                    <th>Đường dẫn</th> 
                                    <th>Ghi chú</th>
                                </tr>
                                </thead>
                                <tbody>
                                <asp:Repeater runat="server" ID="rpDSPhanMem" OnItemCommand="rpPhanMem_OnItemCommand">
                                    <ItemTemplate> 
                                    <asp:HiddenField runat="server" ID="H_MaPhanMem" Value='<%# Eval("MaPhanMem") %>'/>     
                                    <tr>
                                    <td><%# Container.ItemIndex + 1%></td> 
                                    <td><asp:ImageButton runat="server" Width="16px" ID="cmdSelect" CommandName="Select" CommandArgument='<%# Eval("MaPhanMem") %>' ImageUrl='<%# getAnh(Eval("MaPhanMem")) ==true? "~/Images/checked_checkbox.png":"~/Images/unchecked_checkbox.png" %>'/> <%# Eval("TenPhanMem") %></td>
                                    <td><%# Eval("DungLuong") %></td> 
                                    <td><%# Eval("DuongDan") %></td>
                                    <td><%# Eval("GhiChu") %></td>  
                                    </tr>
                                    </ItemTemplate>
                                </asp:Repeater> 
                                </tbody>
                        </table>
                        </div>  
            </section>
        </div>
    </div> 
    
 
            </asp:Panel>   

             <asp:Panel CssClass="row" ID="pnDSPhanMem" runat="server" Visible="False">   
              <div class="col-lg-12">
            <section class="panel">
        <section class="panel">  

            <div class="panel-body">
                 
                <table class="table table-striped">
                                <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Tên phần mềm</th>
                                    <th>Dung lượng</th>
                                    <th>Đường dẫn</th> 
                                    <th>Ghi chú</th>
                                </tr>
                                </thead>
                                <tbody>
                                <asp:Repeater runat="server" ID="rpPhanMem">
                                    <ItemTemplate>     
                                    <tr>
                                    <td><%# Container.ItemIndex + 1%></td> 
                                    <td><%# Eval("TenPhanMem") %></td>
                                    <td><%# Eval("DungLuong") %></td> 
                                    <td><%# Eval("DuongDan") %></td>
                                    <td><%# Eval("GhiChu") %></td>  
                                    </tr>
                                    </ItemTemplate>
                                </asp:Repeater> 
                                </tbody>
                        </table>
            </div> 
            </section>
                    </section>
        </div>
             </asp:Panel> 
             
                
            </div>    
            </section>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress runat="server" ID="UpdateProgress2" AssociatedUpdatePanelID="upPanel1">
        <ProgressTemplate>
            <div style="top: 20%; right: 50%; transition: all 300ms ease 100ms; color: Black;
                padding: 8px; position: fixed; z-index: 10000">
                <asp:Image runat="server" ID="imgloading" ImageUrl="~/Images/loading.gif" /></div>
        </ProgressTemplate>
    </asp:UpdateProgress>
</asp:Content>
